package com.tzx.lifehousekeeper.utils;

import org.jasypt.encryption.StringEncryptor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * @Author tuzongxun
 * @Date 2021/9/22
 */
@Component
public class JasyptTest {

	@Autowired
	StringEncryptor encryptor;
	//加密
	public void getPass(){
		String name = encryptor.encrypt("root");
		String password = encryptor.encrypt("123456");
		System.out.println(name); //hifVDwDPW5MNYa0tAabvJQ==
		System.out.println(password);  //5mTXmB5IYPxqiSuD/045cjHEkJz2NhNi
	}

}
